<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.kaishengit.entity.Project" %>
<%@ page import="com.kaishengit.entity.Goal" %>
<%@ page import="com.kaishengit.entity.Project" %>
<%@ page import="com.kaishengit.entity.User" %>


<!DOCTYPE HTML>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title></title>
	<link rel="stylesheet" href="css/bootstrap.min.css" />
	<script type="text/javascript"src="js/jquery.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	
	<style type="text/css">
		a:hover{
			text-decoration:none;
		}
	</style>
</head>
<body>
	<div class="navbar">
		<div class="navbar-inner">
			<div class="container">
				 
				<!-- .btn-navbar is used as the toggle for collapsed navbar content -->
				<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
				</a>
				 
				<!-- Be sure to leave the brand out there if you want it shown -->
				<a class="brand" href="#">欢迎使用PM系统</a>
				<ul class="nav" >
					<li  style="margin-left:40px;">
						<a href="personmanager.jspx">成员管理</a>
					</li>
					<li><a href="newproject.jspx" style="margin-left:40px;">新建项目</a></li>
					<li class="active"><a href="projectviewlist.jspx" style="margin-left:40px;">项目列表</a></li>
					<li><a href="#" style="margin-left:40px;">我的任务</a></li>
					<li><a href="#" style="margin-left:40px;">附加功能</a></li>
				</ul>
				 
				<!-- Everything you want hidden at 940px or less, place within here -->
				<ul class="nav pull-right">
					<li>
						<a href="#">欢迎您：</a>
					</li>
					<li class="divider-vertical"></li>
					<li style="margin-top:10px;"><%=((User)session.getAttribute("session_user")).getUsername() %></li>
				</ul>
			</div>
		</div>
    </div>
    
    <%
    		HashMap numbers = (HashMap)request.getAttribute("numbers");
    		List<Project> listproject = (List<Project>)request.getAttribute("listproject");
    %>
    
    <%
    	//for(Project project : listproject) {
    		if(listproject.size()!=0){
    		for(int i=0;i<listproject.size();i++){
    			Project project = listproject.get(i);
    %>
	
	<ul class="breadcrumb" style="margin-left:200px;margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:15px;width:800px;">
		<li class="active">
			<a href="project.html">
				<i class="icon-th"></i>
				<%=project.getName() %>
			</a>
		</li>
	</ul>
	<div style="border:1px #ccc solid;margin-left:200px;width:828px;border-top:none;height:auto;">
		<p style="padding:15px;border-bottom:1px #ccc solid;"><%=project.getDesc()%></p>
		
		<p class="span8">
			<table class="table table-striped">
				<thead style="font-size:16px;">
					<tr>
						
						<th style="min-width:130px;">目标名：</th>
						<th style="min-width:330px;">目标简介：</th>
						
					</tr>
				</thead>
				<tbody >
				<%
					List<Goal> listgoal = (List<Goal>)numbers.get(project.getName());
					System.out.println(listgoal);
					
					if(listgoal.size()==0) {
											
				%>
				
					<tr>
						<td id="<%=i%>" colspan="2">该项目暂且没有目标</td>
					</tr>
					
					
					
					
				<%} else if(listgoal!=null){
					for(Goal goal:listgoal) {
				%>
					<tr>
						
						<th><%=goal.getName() %></th>
						<th><%=goal.getDesc() %></th>
					</tr>
					
					
				<%} %>
				<%} %>	
				</tbody>
			</table>
		</p>
		
		
		
		<a id="foward" href="goallistview.jspx?project=<%=project.getName()%>"><button class="btn btn-primary" style="margin-left:570px;margin-bottom:20px;">目标列表</button></a>
		<a href="newgoalview.jspx?project=<%=project.getName()%>"><button class="btn btn-success" style="margin-bottom:20px;">添加目标</button></a>
		
		
	</div>
	
	
	<%}}else {%>
	
	
		<ul class="breadcrumb" style="margin-left:200px;margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:15px;width:800px;">
		<li class="active">
			<a href="project.html">
				<i class="icon-th"></i>
				项目名称暂无
			</a>
		</li>
	</ul>
	<div style="border:1px #ccc solid;margin-left:200px;width:828px;border-top:none;height:auto;">
		<p style="padding:15px;border-bottom:1px #ccc solid;">项目简介暂无</p>
		
		<p class="span8">
			<table class="table table-striped">
				<thead style="font-size:16px;">
					<tr>
						
						<th style="min-width:130px;">目标名：</th>
						<th style="min-width:330px;">目标简介：</th>
						
					</tr>
				</thead>
				<tbody >
					<tr>
						<td colspan="2">目标暂无</td>
					</tr>
				
				</tbody>
			</table>
		</p>
		
		
		
		<a id="foward" href=""><button class="btn btn-primary" style="margin-left:570px;margin-bottom:20px;">目标列表</button></a>
		<a href=""><button class="btn btn-success" style="margin-bottom:20px;">添加目标</button></a>
		
		
	</div>
	
	
	
	<%} %>

	
</body>
</html>